package com.mhd.mq_to_es.esvo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
// createIndex 是否随IOC容器启动自动创建索引
@Document(indexName = "coupon_info",shards = 2,replicas = 1,createIndex = true)
public class CouponInfo {
    /**
     * 优惠券id
     */
    @Id
    @Field(type = FieldType.Long)
    private Integer id;
    /**
     * 优惠券类id
     */
    @Field(type = FieldType.Keyword)
    private Integer couponId;

    /**
     * 用户id
     */
    @Field(type = FieldType.Keyword)
    private Integer userId;

    /**
     * 是否被使用
     */
    @Field(type = FieldType.Keyword)
    private String isUserd;

    /**
     * 创建时间
     */
    @Field(type = FieldType.Date)
    private Date createTime;
}
